package be.ipl.albums.domaine;

import java.io.Serializable;

import javax.persistence.Embeddable;

@SuppressWarnings("serial")
@Embeddable
public class AlbumPK implements Serializable{
	private String nom;
	private String artiste;
	
	public AlbumPK() {}
	
	public AlbumPK(String nom, String artiste) {
		this.nom = nom;
		this.artiste = artiste;
	}
	public String getNom() {
		return nom;
	}
	public String getArtiste() {
		return artiste;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((artiste == null) ? 0 : artiste.hashCode());
		result = prime * result + ((nom == null) ? 0 : nom.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		AlbumPK other = (AlbumPK) obj;
		if (artiste == null) {
			if (other.artiste != null)
				return false;
		} else if (!artiste.equals(other.artiste))
			return false;
		if (nom == null) {
			if (other.nom != null)
				return false;
		} else if (!nom.equals(other.nom))
			return false;
		return true;
	}
	
	
	
}
